package org.example06;

import org.example06.ba07.SomeServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyTest07 {
    @Test
    public void test01(){
        String config = "applicationContext.xml";

        ApplicationContext ac =new ClassPathXmlApplicationContext(config);
        SomeServiceImpl proxy = (SomeServiceImpl) ac.getBean("someService");

        /**
         * 目标类没有接口，使用cglib动态代理。spring框架会自动应用cglig。
         */
        System.out.println("p:"+proxy.getClass().getName());
        proxy.doThird();
    }


}
